#ifndef PROTECT_BUDDY_SYSTEM
#define PROTECT_BUDDY_SYSTEM

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define NODE_POOL_SIZE			100024
#define NODE_MAX_CNT			10000000
#define FREE_LIST_LENGTH		162
#define HASH_LENGTH				1000004
#define HASH_MOD				1000004
#define HASH_DELETE_FAIL		-4
#define PTR_UNAVAILABLE			-1
#define DISK_ALLOC_FAIL			-2
#define NOT_HAVE_ENOUGH_SPACE	-3

typedef struct NODE
{
	int ptr_disk;
	int flist_pre, flist_suc;
	int node_pre, node_suc;
	int size;
	int used;
}NODE;


void disk_init();
int disk_alloc(int);
void disk_free(int);

#endif
